import React, { FC } from 'react';
import { isFunction } from 'lodash';

const COM_PREKEY = 'ResumeTmplCenterAction';

interface ResumeTmplCenterActionProps {
    onQuickPrefixClick?: () => void;
}

const ResumeTmplCenterAction: FC<ResumeTmplCenterActionProps> = (props) => {
    return (
        <div className="center-action">
            <span
                className="btn is-round"
                onClick={(e) => {
                    e.preventDefault();
                    e.stopPropagation();

                    if (isFunction(props.onQuickPrefixClick)) {
                        props.onQuickPrefixClick();
                    }
                }}
            >
                快速预览
            </span>
        </div>
    );
};

ResumeTmplCenterAction.displayName = 'ResumeTmplCenterAction';

export { ResumeTmplCenterAction, ResumeTmplCenterActionProps };
